package safeCommitter.core.diffrunbridge;

import java.util.HashSet;
import java.util.Set;

import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.action.IAction;
import org.tigris.subversion.subclipse.ui.operations.CommitOperation;

import safeCommitter.model.adpters.ClassEntity;
import safeCommitter.model.adpters.ISCTest;

/**
 * {@link ExecutorBridge} will not execute a search for the related tests
 * between the diffs and the executor phases.
 * 
 * @author Luiz Henrique
 * 
 */
public class ExecutorBridge implements IExecutorBridge {

	private final RunTestPhaseStarter runTestPhaseStarter = new RunTestPhaseStarter();

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * safeCommitter.core.diffrunbridge.IExecutorBridge#executeTests(org.eclipse
	 * .jface.action.IAction, org.eclipse.jdt.core.IJavaProject, java.util.Set,
	 * org.tigris.subversion.subclipse.ui.operations.CommitOperation)
	 */
	public void executeTests(final IAction action,
			final IJavaProject javaProject,
			final Set<ClassEntity> clazzEntities, final CommitOperation c) {
		try {
			runTestPhaseStarter.doExecute(javaProject, c,
					new HashSet<ISCTest>());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
